<!--
 * @Author: your name
 * @Date: 2022-01-12 11:02:51
 * @LastEditTime: 2022-01-12 11:05:15
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \算法测试\day0906\喜好度.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var abc = function () {
            let result = [];
            for (let i = 3; i < arguments.length; i++) {
                let num = 0;
                for (let j = arguments[i][0] - 1; j < arguments[i][1]; j++) {
                    if (arguments[1][j] === arguments[i][2]) num++;
                }
                result.push(num);
            }
            return result;
        }
        console.log(abc(5,[1,2,3,3,5],3,[1,2,1],[2,4,5],[3,5,3])); 
    </script>
</body>

</html>